// roll  word  class
export default class RollWord {
  constructor(ele, x, y, z, cx, cy, fallLength = 500) {
    this.ele = ele
    this.x = x
    this.y = y
    this.z = z
    this.bx = x
    this.by = y
    this.bz = z
    this.cx = cx
    this.cy = cy
    this.fallLength = fallLength
  }

  /**
   * 移动函数
   */
  move() {
    let scale = this.fallLength / (this.fallLength - this.z)
    this.ele.style.fontSize = 23 * scale + 'px'
    this.ele.style.zIndex = parseInt(scale * 100)
    this.ele.style.left = this.x + this.cx - this.ele.offsetWidth / 2 + 'px'
    this.ele.style.top = this.y + this.cy - this.ele.offsetHeight / 2 + 'px'
  }
}

